import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import { nanoid } from "nanoid";
router.beforeEach((to, from, next) => {
  /* 路由发生变化修改页面title */
  if (to.meta.title) {
    document.title = to.meta.title;
  }
  next();
});
import {
  Button,
  Calendar,
  Cell,
  Tabbar,
  TabbarItem,
  Swipe,
  SwipeItem,
  Lazyload,
  Col,
  Row,
  List,
  Toast,
  Loading,
} from "vant";
Vue.use(List);
Vue.use(Button);
Vue.use(Calendar);
Vue.use(Cell);
Vue.use(Tabbar);
Vue.use(TabbarItem);
Vue.use(Swipe);
Vue.use(SwipeItem);
Vue.use(Lazyload);
Vue.use(Loading);
Vue.use(Col);
Vue.use(Row);
Vue.prototype.$nanoid = nanoid;
Vue.prototype.$Toast = Toast;
Vue.config.productionTip = false;
new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount("#app");
